package regexObject;

import java.util.Arrays;

/*定义字符串String path = "http://localhost:8088/myweb/reg?name=zhangsan&pwd=123456&nick=san&age=16";

   要求得到并输出：参数名:name  参数值：zhangsan

   ​                               参数名:pwd    参数值:  123456

   ​                               参数名:nick     参数值: san

   ​                               参数名:age      参数值: 16*/
public class Test {
    public static void main(String[] args) {
        String path = "http://localhost:8088/myweb/reg?name=zhangsan&pwd=123456&nick=san&age=16";
        String[] split = path.split("\\?");
        String[] split1 = split[1].split("&");
        for (int i = 0; i < split1.length; i++) {
            String[] split2 = split1[i].split("=");
            System.out.println("参数名:" + split2[0] + "\t" + "  参数值：" + split2[1]);
        }

    }
}
